import Common from '../../common/common.js';
import BlackList from './BlackList.js';

const doms = {
     blacklist:Common.tool.getElementByID("blacklist")
}

const blackList = new BlackList();


const setBlackUser = function(userIds){
    blackList.updateData(userIds)
}

//判断用户是否是黑名单
const isBlack = function(userID){
    let item = blackList.getItems().filter(v=>v.data.userID == userID);
    return item.length > 0;
}
const clear = function(){
    blackList.clearItems();
}

doms.blacklist.appendChild(blackList.getElement());

export default {
    setBlackUser:setBlackUser,
    isBlack:isBlack,
    clear:clear
};
